import imageLoad from './imageLoad'
import createImage from './createImage';
import addPort from './addPort';
class addSlot {
  constructor (param) {
    this.color = 'red'
    this.param = param
  }
  async draw (slot) {
    console.log("draw slot1:", slot)
    //this.param.ctx.fillStyle = this.color; // 设置绘图颜色为红色
    //this.param.ctx.fillRect(port.pos.x * this.param.ratio, port.pos.y * this.param.ratio, port.size.width * this.param.ratio, port.size.height * this.param.ratio);
    await new createImage({
      port: slot,
      ctx: this.param.ctx,
      ratio:this.param.ratio
    }).draw()
    new addPort({
      ports:slot.boardPort.port,
      basePos:slot.pos,
      color: 'green',
      ratio: this.param.ratio,
      ctx: this.param.ctx,
    }).draw()
  }
}

export default addSlot